﻿#region Using

using System;
using System.Collections.Generic;
using System.Collections.Specialized;

#endregion

namespace BlogEngine.Core
{
    /// <summary>
    /// An interface implemented by the classes that can be commented on.
    /// <remarks>
    /// To implement this interface means that the class can have comments added to it,
    /// approved, etc.
    /// </remarks>
    /// </summary>
    public interface ICommentable
    {

        /// <summary>
        /// Gets the author.
        /// </summary>
        /// <value>The author.</value>
        String Author { get;}

        /// <summary>
        /// Gets a collection of email addresses that is signed up for 
        /// comment notification on the specific item.
        /// </summary>
        StringCollection NotificationEmails { get; }

        /// <summary>
        /// Collection of all Comments for the item whether they are approved or not
        /// </summary>
        List<Comment> Comments { get; }

        /// <summary>
        /// Gets or sets the EnableComments of the object.
        /// </summary>
        bool IsCommentsEnabled { get; set; }

        /// <summary>
        /// The date on which the instance was created.
        /// </summary>
        DateTime DateCreated { get; set; }

        /// <summary>
        /// Gets or sets the Title or the object.
        /// </summary>
        string Title { get; set; }

        /// <summary>
        /// A relative-to-the-site-root path to the item. Only for in-site use.
        /// </summary>
        string RelativeLink { get; }

        /// <summary>
        /// Gets the absolute link.
        /// </summary>
        /// <value>The absolute link.</value>
        Uri AbsoluteLink { get;}

        /// <summary>
        /// A collection of comments waiting for approval for the item, sorted by date.
        /// </summary>
        List<Comment> NotApprovedComments { get; }

        /// <summary>
        /// A collection of Approved comments for the item, sorted by date.
        /// </summary>
        List<Comment> ApprovedComments { get; }

        /// <summary>
        /// Adds a comment to the collection and saves the item.
        /// </summary>
        /// <param name="comment">The comment to add to the item.</param>
        void AddComment(Comment comment);

        /// <summary>
        /// Approves a Comment for item.
        /// </summary>
        /// <param name="comment">The Comment to approve</param>
        void ApproveComment(Comment comment);

        /// <summary>
        /// Approves all the comments in an item.  Included to save time on the approval process.
        /// </summary>
        void ApproveAllComments();

        /// <summary>
        /// Removes a comment from the collection and saves the item.
        /// </summary>
        /// <param name="comment">The comment to remove from the item.</param>
        void RemoveComment(Comment comment);

  }
}